/*** 
 * @Author: Yanan Chen
 * @Date: 2021-11-02 13:47:03
 * @LastEditTime: 2021-12-15 14:56:03
 * @LastEditors: Yanan Chen
 * @Description: 
 * @FilePath: \sadwinner\fw\esp32\Src\APP\app_ui.h
 * @
 */
#ifndef PRJ_APP_UI_H
#define PRJ_APP_UI_H
#include <stdio.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#include "hal_function.h"
#include "ssd1306.h"
#include "lv_port_disp.h"
#include "lv_conf.h"
#include "oled_mgr.h"
typedef enum {
    LED_MODE_ON,
    LED_MODE_OFF,
    LED_MODE_FLASH,
    LED_MODE_BREATH,
}LED_MODE;



class AppUI_LED 
{
public:
    AppUI_LED();
    ~AppUI_LED(){};

    void LED_Set(LED_MODE mode,int frequence);
    void LED_Run(int time);
private:
    LED_MODE led_mode;
    char status;
    int led_frequence;
    int led_cnt;
    char breath_flag;
};


class AppUI_OLED 
{
public:
    AppUI_OLED(){};
    ~AppUI_OLED(){};
    void OLED_Run();
private:
  
};

class AppUI_EPAPER 
{
public:
    AppUI_EPAPER(){};
    ~AppUI_EPAPER(){};
    void EPAPER_Run();
private:
   
};

class AppUI : public AppUI_LED, public AppUI_OLED
{
public:
    AppUI();
    ~AppUI(){};
    static void threadCreate();
    static void rootStyleInit();
private:
    static TaskHandle_t  taskHandle;
    static TimerHandle_t timerHandle;
    static void thread(void *a);
    static void threadtimeCallback(TimerHandle_t handle);
};

#endif